/*
 * power_manage.h
 *
 * realize power funtion.
 *
 * Copyright (C) 2024 Sinh Micro, Inc.
 * Subject to the GNU Public License, version 2.
 *
 * Author: lixiang<lixiang@sinhmicro.com>
 * 
 * Encoding format: GB2312
 * Version: v1.2.2
 * Date: 2024-11-05
 */

#include "hal/inc/types.h"

#ifndef _POWER_MANAGE_H_
#define _POWER_MANAGE_H_

#define TSSTAT  (*(volatile unsigned char xdata*)(0xFE24))

#define MIC_SLEEP_SET()     do {                   \
                               CLKEN1 &= ~0x08;    \
                               TSSTAT &= 0x10;     \
                               } while (0)         
        
void pm_handle_light_load_100ms(void);
void pm_sleep_handle(void);
void pm_sleep_cnt_reset(void);
void pm_sleep_cnt_set(uint8_t cnt);
#endif